<?php
// 应用公共文件


function showSuccess($data=[], $msg= 'ok', $code= 200) {
    return json(["code"=>200,"message"=>$msg,'data'=>$data,"type"=>'success'],200);
}
function showError($msg= 'ok', $code= -1,$result= null) {
    return json(["code"=>$code,"message"=>$msg,"result"=>$result,"type"=>"error"],200);
}

function uuid()
{
    $chars=md5(uniqid(mt_rand(), true));
    $uuid = substr($chars,0,8).substr($chars,8,4).substr($chars,12,4).substr($chars,16,4).substr($chars,20,12);
    return $uuid;
}